﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="SiteDomain.aspx.cs" Inherits="Billing2.SiteDomain" %>
<%@ Register Src="~/Controls/Admin/ucSiteDomain.ascx" TagName="ucSiteDomain" TagPrefix="uc1" %>
<%@ Register src="~/Controls/ucPageTitle.ascx" tagname="ucPageTitle" tagprefix="uc2" %>
<%@ Register src="~/Controls/ucInProgress.ascx" tagname="ucInProgress" tagprefix="uc3" %>
<%@ Register src="~/Controls/ucSearch.ascx" tagname="ucSearch" tagprefix="uc4" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        $(function () {
            // Dialog 
            $('#dialogSave').dialog({
                autoOpen: false,
                width: 600,                                
                modal: true
            });
            $('#dialog').parent().appendTo($("form"));

            $('#dialogUpdate').dialog({
                autoOpen: false,
                width: 600,
                modal: true
            });
            $('#dialog').parent().appendTo($("form"));
        });       
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <uc2:ucPageTitle ID="ucPageTitle1" runat="server" />
      <asp:UpdatePanel ID="UpdatePanel5" runat="server">
    <ContentTemplate>
         <uc4:ucSearch ID="ucSearch" runat="server" />
    </ContentTemplate>
    </asp:UpdatePanel>
    <br />
    <asp:UpdatePanel ID="UpdatePanel3" runat="server">
        <ContentTemplate><div class="gridDetail">
            <asp:GridView ID="gvwSiteDomain" runat="server" CellPadding="4" CssClass="GridViewStyle"
                GridLines="Horizontal" AutoGenerateColumns="False" 
                OnRowCommand="gvwSiteDomain_RowCommand" AllowPaging="True" AllowSorting="True" 
                onpageindexchanging="gvwSiteDomain_PageIndexChanging" PageSize="50" EnableSortingAndPagingCallbacks="True" 
                onsorting="gvwSiteDomain_Sorting" PagerSettings-Mode="NumericFirstLast" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" ForeColor="Black">
                <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                <RowStyle CssClass="GridViewRowStyle" />
                <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                <HeaderStyle CssClass="GridViewHeaderStyle" BackColor="#333333" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                <Columns>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="No">
                        <ItemTemplate>
                            <asp:Label ID="xCol01" runat="server" Text='<%#Container.DataItemIndex+1  %>'></asp:Label>
                        </ItemTemplate>                       
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" 
                        HeaderText="Organization ID" SortExpression="OrgIDName">
                        <ItemTemplate>                            
                            <%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("OrgIDName")))%>
                        </ItemTemplate>                     
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Site ID" 
                        SortExpression="SiteIDName">
                        <ItemTemplate>
                            <asp:LinkButton runat="server" ID="linkBtnEdit" CommandArgument='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("ID")))%>'
                                CommandName="EditData" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("SiteIDName")))%>' ></asp:LinkButton>
                        </ItemTemplate>                    
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Domain" 
                        SortExpression="DomainName">
                        <ItemTemplate>
                            <asp:Label ID="xCol04" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("DomainName")))%>'></asp:Label>
                        </ItemTemplate>                     
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Active" 
                        SortExpression="DomainStatus" >
                        <ItemTemplate>
                            <asp:Label ID="xCol05" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("DomainStatus")))%>'></asp:Label>
                        </ItemTemplate>                       
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                </Columns>
                <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
            </asp:GridView></div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <br />
    
    <asp:UpdatePanel ID="UpdatePanel4" runat="server">
        <ContentTemplate>
            <asp:Button ID="btnAdd" runat="server" Text="Add" CausesValidation="false" CssClass="ui-state-default ui-corner-all"
                OnClick="btnAdd_Click" />
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel4">
    <ProgressTemplate>
        <uc3:ucInProgress ID="ucInProgress" runat="server" />        
    </ProgressTemplate>
    </asp:UpdateProgress>
    <br />
    
    <br />
    <div id="dialogSave" title="Add Site Domain" style="display: none">
        <div id="dialogSaveEffect">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <uc1:ucSiteDomain ID="ucSiteDomain1" runat="server" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </div>
    <div id="dialogUpdate" title="Edit Site Domain" style="display: none">
        <div id="dialogUpdateEffect">
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
            <ContentTemplate>
                <uc1:ucSiteDomain ID="ucSiteDomain2" runat="server" />
            </ContentTemplate>
        </asp:UpdatePanel>
        </div>
    </div>
    <br />     
    
</asp:Content>
